package com.example.rbacmanage.vo;

import com.alibaba.fastjson2.JSON;

import java.io.Serializable;
import java.util.LinkedHashMap;

public class WsBean extends LinkedHashMap<String,Object> implements Serializable {
    public enum CallbackEm{
        notice,
        receive_msg,
    }
    public WsBean(CallbackEm callbackEm,Object data){
        super();
        this.put("callbackEm",callbackEm);
        this.put("data",data);
    }
    public static WsBean get(CallbackEm callbackEm){
        return new WsBean(callbackEm,null);
    }
    public static WsBean get(CallbackEm callbackEm,Object data){
        return new WsBean(callbackEm,data);
    }
    public WsBean setData(Object data){
        this.put("data",data);
        return this;
    }
    public WsBean set(String key,Object value){
        this.put(key,value);
        return this;
    }
    public String toJson(){
        return JSON.toJSONString(this);
    }
}
